package com.geekstudy.week10.service;

import com.geekstudy.week10.api.UserApi;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.function.Supplier;


@Service
public class SupplierService implements Supplier<String> {

    final Logger logger = LoggerFactory.getLogger(SupplierService.class);

    @Autowired
    private UserApi userApi;

    private String userId = "userId2021";

    @Override
    public String get() {
        logger.info("get");
        String info = userApi.findUsername(userId);
        return info;
    }

}
